package day02;

public class SwapVarDemo {
    public static void main(String[] args) {
        int a = 10;
        int b = 20;
        int temp = a;
        a = b;
        b = temp;
        System.out.println("a:"+a);
        System.out.println("b:"+b);

        int m = 10;
        int n = 20;
        m = m ^ n;
        n = m ^ n;
        m = m ^ n;
        System.out.println("m:"+m);
        System.out.println("n:"+n);

        int x = 10;
        int y = 20;
        y = x^(x = y)^y;

        System.out.println("x:"+x);
        System.out.println("y:"+y);
    }
}
